home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / doom / axxwar_1.zip / SOURCES / HOLOGRAM.QC < prev    next >
Text File  |  1997-02-27  |  4KB  |  154 lines

  1. // AxxWars 0.8
  2. // AXXHO START
  3.  
  4. .float numholo;                             // AXXHO    
  5.  
  6. /*
  7. ==========
  8. Spawn_hfog
  9. ==========
  10. */
  11. void(vector org) spawn_hfog =
  12. {
  13.     s = spawn ();
  14.     s.origin = org;
  15.     s.nextthink = time + 0.2;
  16.  
  17.     WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  18.     WriteByte (MSG_BROADCAST, TE_TELEPORT);
  19.     WriteCoord (MSG_BROADCAST, org_x);
  20.     WriteCoord (MSG_BROADCAST, org_y);
  21.     WriteCoord (MSG_BROADCAST, org_z);
  22.     remove (s);
  23. };
  24.  
  25. /*
  26. ================
  27. hologram_explode
  28. ================
  29. */
  30. void(entity ex) hologram_explode =
  31. {
  32.            ex.owner.numholo = ex.owner.numholo - 1;
  33.         makevectors(ex.angles);
  34.         sound (self, CHAN_VOICE, "player/holooff.wav", 1, ATTN_NORM);
  35.         spawn_hfog (ex.origin);
  36.         ex.nextthink = time + 0.1;
  37.         ex.think = SUB_Remove;
  38. };
  39.  
  40. /*
  41. ==============
  42. CheckForCamper
  43. ==============
  44. */
  45. void() holo_touch =
  46. {
  47.         makevectors(self.angles);
  48.         if (other == self.owner)
  49.                 sound (self, CHAN_AUTO, "player/hologon.wav", 1, ATTN_NORM);
  50.         else
  51.                 sound (self, CHAN_AUTO, "items/Inv1.wav", 1, ATTN_NORM);
  52.         spawn_hfog (self.origin);
  53. };
  54.  
  55. /*
  56. ======
  57. Holo_i
  58. ======
  59. */
  60. void() holo_i =
  61. {
  62.       self.touch = holo_touch;
  63.       self.owner.ammo_cells = self.owner.ammo_cells - 1;
  64.       if (self.owner.weapon == IT_LIGHTNING) 
  65.           self.owner.currentammo = self.owner.ammo_cells;
  66.       if (self.owner.ammo_cells <= 0)
  67.         {
  68.              hologram_explode(self);
  69.           }
  70.     else
  71.         {
  72.              self.frame = self.frame + 1;
  73.         if (self.holotype == 1)
  74.             {
  75.             if (self.frame < 0 || self.frame > 12)
  76.                 self.frame = 1;
  77.                 self.colormap = 0;
  78.             }
  79.         else
  80.         if (self.holotype == 2)
  81.         {    // setmodel (hologram, "progs/shambler.mdl");
  82.             if (self.frame < 0 || self.frame > 16)
  83.             self.frame = 1;
  84.             self.colormap = 0;
  85.         }
  86.     else
  87.           {    // setmodel (hologram, "progs/player.mdl");
  88.               if (self.frame < 12 || self.frame > 16)
  89.                         self.frame = 12;
  90.         self.colormap = self.owner.colormap;
  91.         }    
  92.         self.skin = self.owner.skin;
  93.              self.nextthink = time + 0.5;
  94.              self.think = holo_i;
  95.         }
  96. };
  97.  
  98. /*
  99. ===============
  100. Launch_Hologram
  101. ===============
  102. */
  103.  
  104. void(vector org, vector dir) launch_hologram =
  105. {
  106.     if ((self.ammo_cells < 12) || (self.numholo > 2)) 
  107.         return;
  108.       hologram = spawn ();
  109.       hologram.owner = self;
  110.     self.numholo = self.numholo + 1;
  111.       self.myhologram = hologram;
  112.       hologram.flags = FL_ITEM;
  113.       hologram.movetype = MOVETYPE_STEP;
  114.       hologram.solid = SOLID_TRIGGER;
  115.       hologram.angles = vectoangles(dir);
  116.     hologram.angles_x = 0;
  117. // AXXSH START
  118.     if (self.class == CL_FIEND)
  119.         {    
  120.         setmodel (hologram, "progs/demon.mdl");
  121.         self.holotype=1;
  122.         hologram.colormap = 0;
  123.         hologram.frame = 1;        
  124.         }
  125.     else
  126.     if (self.class == CL_SHAMBLER)
  127.         {    
  128.         setmodel (hologram, "progs/shambler.mdl");
  129.         self.holotype = 2;
  130.         hologram.colormap = 0;
  131.         hologram.frame = 1;        
  132.         }
  133.     else
  134. // AXXSH END
  135.             {    
  136.         setmodel (hologram, "progs/player.mdl");
  137.             hologram.colormap = self.colormap;      
  138.         hologram.frame = 13;      
  139.         }
  140.       hologram.skin = self.skin_temp;
  141.         setsize (hologram, '-16 -16 -24', '16 16 40');
  142.         setorigin (hologram, org);
  143.         hologram.velocity = dir * 10;
  144.         hologram.classname = "hologram";
  145.         hologram.nextthink = time + 1;
  146.         hologram.think = holo_i;//This is the start of the
  147.                                           //bobbing up and down.
  148.         sound (self, CHAN_AUTO, "player/hologon.wav", 1, ATTN_NORM);
  149.         sprint (self, "Hologram launched...\n");
  150. };
  151. // AXXHO END
  152.  
  153.  
  154.